home *** CD-ROM | disk | FTP | other *** search
/ The Arcade BBS / arcadebbs.zip / arcadebbs / bbstools / WWIV Mods / WWIVMOD.ZIP / M&M001.MOD < prev    next >
Encoding:
Text File  |  1993-04-10  |  4.5 KB  |  130 lines

  1. File name      : M&M001.MOD
  2. Written by     : Snorkel 1@3459 WWIVnet
  3. Written for    : WWIV v4.22
  4. Date written   : 2-14-93
  5. Files affected : BBS.C
  6.                  BBSUTL1.C
  7.                  FCNS.H
  8. Mod function   : Restricts users from doing file transfers during specified 
  9.                  hours of the day.
  10.  
  11.  
  12. With this mod, you can restrict the times someone can do file transfers.  It
  13. is currently set to not allow file transfers (uploads, downloads and file
  14. extractions) between the hours of 6pm to 10pm.  If you want to change those
  15. hours, simply change the "1800" and "2200" in the "if" line of the function.
  16. The times are expressed in "military time" and can be changed very easily
  17. (ie - 1934 = 7:34pm).  It also allows someone with FULL cosysop status to be
  18. exempt from the restriction (that can be changed to sysop by changing "cs()"
  19. to "so()").
  20.  
  21. Rather than use this function to entirely lock users out of the transfer area,
  22. I suggest that you use it to "disable" certain functions WITHIN the transfer
  23. area.  This way, users can still look through the files, without having to
  24. call back.  Step 2 shows how I suggest locking users out of file transfer
  25. functions INDIVIDUALLY.
  26.  
  27.  
  28. =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  29. Step 1
  30.  
  31.  
  32. In BBSUTL1.C, add the following function anywhere you want:
  33.  
  34.  
  35. int no_transfer()                 /* Begin block copy */
  36. {
  37. /* Insert Step 4 here if you want to allow file transfers       */
  38. /* during these times on SPECIFIC days (WWIV 4.22 or later ONLY */
  39.   if ((timer()>1800*36.0) && (timer()<2200*36.0) && (!(cs()))) {
  40.     nl();
  41.     pl("File transfers not allowed during \"prime time\".");
  42.     nl();
  43.     sysoplog("<***> Tried to transfer files during prime time <***>");
  44.     return(1);
  45.   } else
  46.     return(0);
  47. }                                  /* End block copy */
  48.  
  49. =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  50. Step 2
  51.  
  52. In BBS.C, add the following code where indicated to "void dlmainmenu()"
  53.  
  54.  
  55.       case 'D':                      /* existing code */
  56.         if(!no_transfer()) {         /* add */
  57.           helpl=20;
  58.           download();
  59.         }                            /* add */
  60.         break;
  61.  
  62.  
  63.       case 'E':                      /* existing code */
  64.         if(!no_transfer()) {         /* add */
  65.           helpl=29;
  66.           temp_extract();
  67.         }                            /* add */
  68.         break;
  69.  
  70.  
  71.       case 'U':                      /* existing code */
  72.         if(!no_transfer()) {         /* add */
  73.           helpl=17;
  74.           if ((thisuser.restrict & (restrict_validate | restrict_upload)) || (syscfg.sysconfig & sysconfig_all_sysop)) {
  75.             if (syscfg.newuploads<num_dirs)
  76.               upload((int) syscfg.newuploads);
  77.             else
  78.               upload(0);
  79.           } else
  80.             upload(udir[curdir].subnum);
  81.         }                            /* add */
  82.         break;
  83.  
  84.  
  85.       case 'Z':                      /* existing code */
  86.         if(!no_transfer()) {         /* add */
  87.           nl();
  88.           helpl=17;
  89.           upload(0);
  90.         }                            /* add */
  91.         break;
  92.  
  93.  
  94. =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  95. Step 3
  96.  
  97. In FCNS.H, add the following code where indicated:
  98.  
  99.  
  100. /* File: bbsutl1.c */                 /* existing line */
  101.  
  102. int no_transfer();                    /* add */
  103. int ok_local();
  104. int finduser1(char *sx);
  105.  
  106.  
  107. =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  108. Step 4 (WWIV v4.22 or later)
  109.  
  110. Add this code where indicated in the new function if you want to allow file 
  111. transfers during "prime time" on certain days.  The day(s) of the week you 
  112. choose are represented by the numbers 0-6 (0 being Sunday, and 6 being 
  113. Saturday).  In this example, the days are Saturday and Sunday, but you can 
  114. change the numbers, or add or subtract any day you wish.
  115.  
  116.  
  117.   unsigned char thisday;                       /* ADDED */
  118.                                                /* ADDED */
  119.   thisday=dow();                               /* ADDED */
  120.   if((thisday==0) || (thisday==6))             /* ADDED */
  121.     return(0);                                 /* ADDED */
  122.  
  123. =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  124. Step 5
  125.  
  126. You must now recompile the entire BBS since you made an addition to FCNS.H.
  127.  
  128. If you have any questions about this mod, feel free to write me at 1@3459 
  129. WWIVnet.
  130.